import requests

import common.get_02_token
from common.get_02_token import get_02_token


class IhrmAddApi:
    @classmethod
    def add_01(cls,json):
        token =get_02_token.get_02_token()
        url='http://ihrm2-test.itheima.net/api/sys/user'
        headers={
            "Content-Type":"application/json",
            "Authorization":token
        }

        r =requests.post(url,headers=headers,json=json)
        return  r

if __name__ == '__main__':
    json = {
        "username": "小美",
        "mobile": "17740652911",
        "workNumber": "10086"
    }
    r=IhrmAddApi.add_01(json)
    print(r.json())